package main

import (
	"log"
	"sync"
)

const (
	// Selenium Server 的端口
	port = 9515
)

func main() {
	var wg sync.WaitGroup
	service, err := startDriverService()
	if err != nil {
		log.Fatalf("驱动服务启动失败: %s\n", err.Error())
	}
	defer service.Stop()

	wg.Add(1)
	go func() {
		var wd, err_ = CreateWebDriver(CreateWebDriverOpts{
			Headless: true,
		})
		if err_ != nil {
			log.Fatalf("创建浏览器会话失败: %s\n", err_.Error())
		}
		defer wg.Done()
		defer wd.Quit()
		demo1(wd, err)
	}()

	wg.Wait()
}
